package com.dog.basics.security.util;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @program: pillow
 *
 * @description: 验证码扣图模板
 *
 * @author: Guo
 *
 * @create: 2019-12-02 18:30
 **/
@Getter
@AllArgsConstructor
public enum WordCodeTemplatesEnum {
	LPN(0,"1.png"),
	ONE(1,"2.png"),
	TWO(2,"3.png"),
	THREE(3,"4.png"),
	FOUR(4,"5.png"),
			;

	/**
	 * 类型
	 */
	private int code;
	/**
	 * 图片名称
	 */
	private String name;

	/**
	 * 根据Code获取Url
	 * @param code
	 * @return
	 */
	public static String getMessageByCode(int code) {
		for (WordCodeEnum wordCodeEnum : WordCodeEnum.values()) {
			if (code == wordCodeEnum.getCode()) {
				return wordCodeEnum.getName();
			}
		}
		return null;
	}

}
